package com.gitee.huanminabc.utils_tools.security.service.impl;

import com.gitee.huanminabc.utils_tools.security.dal.dao.RoleDaoService;
import com.gitee.huanminabc.utils_tools.security.entity.RoleEntity;
import com.gitee.huanminabc.utils_tools.security.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author huanmin
 */
@Service
public class RoleServiceImpl implements RoleService {
    @Autowired
    private RoleDaoService roleDaoService;


    @Override
    public List<String> getRoles(String url) {
        List<RoleEntity> roles = roleDaoService.getRoles(url);
        return  roles.stream().map(RoleEntity::getCode).collect(java.util.stream.Collectors.toList());
    }
}
